import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: () => {
      return '/page1'
    }
  },
  {
    path: "/",
    name: "home",
    component: () => import("../view/Home.vue")
  },
  {
    path: "/page1",
    name: "page1",
    component: () => import("../view/page1.vue")
  },
  {
    path: "/page2",
    name: "page2",
    component: () => import("../view/page2.vue")
  }
];

const router = new VueRouter({
  routes
});

export default router;
